//========================================================================
/**
 * Author   : cuisw <shaovie@gmail.com>
 * Date     : 2008-08-18 23:09
 */
//========================================================================

#ifndef _LOGOUTPUT_H_
#define _LOGOUTPUT_H_
#include "Pre.h"

#include "LogManager.h"

/**
 * @class LogOutput
 *
 * @brief Defines the interface for Logger output processing.
 *
 * Users can derive classes from LogOutput for use as a custom logger 
 * output.
 */
class LogOutput
{
public:
    // No-op virtual destructor.
    virtual ~LogOutput ();

    /**
     * Open the back end object. Perform any actions needed to prepare
     * the object for later logging operations.
     *
     * @retval 0 for success.
     * @retval -1 for failure.
     */
    virtual int open (const char *logger_arg,
	    LogManager::Strategy *) = 0;

    // Close the output completely.
    virtual int close (void) = 0;

    // Reset the strategy.
    virtual void reset (void) = 0;

    // Update log strategy
    virtual void update_strategy (const char *, LogManager::Strategy *ls) = 0;

    /**
     * Process a log record.
     *
     * @retval -1 for failure; else it is customarily the number of bytes
     * processed, on zero is a no-op.
     */
    virtual int log (const char *log_msg, int len) = 0;
private:
};

#include "Post.h"
#endif

